﻿using AutoMapper;
using SheepStorage.API.Application.Command.ProviderManageCommand;
using SheepStorage.API.Application.Command.EnterpriseCommand;
using SheepStorage.Domain.Entity;
using SheepStorage.Domain.Dto.Output;
using SheepStorage.Domain.Dto.InputDto;
using SheepStorage.API.Application.Command.DepartmentCommand;
using SheepStorage.Domain.DTO.Output;
using SheepStorage.API.Application.Command.UserInfoCommand;
using SheepStorage.Domain.Entity;
using SheepStorage.Domain.DTO.Output;
using SheepStorage.API.Application.Command.SheepPurchaseCommand;
using SheepStorage.API.Application.Command.EarTagCommand;
using SheepStorage.API.Application.Command.PersonnelCommand;
using SheepStorage.API.Application.Command.SheepChangeDormCommand;
using SheepStorage.API.Application.Command.SheepMarkCommand;
using SheepStorage.API.Application.Command.SheepDeathCommand;
using SheepStorage.API.Application.Command.SheepMomWeaningCommand;
using SheepStorage.API.Application.Command.LambWeaningCommand;
using SheepStorage.API.Application.Command.TransferCommand;
using SheepStorage.API.Application.Command.YourTableNameCommand;
using SheepStorage.API.Application.Command.SheepMomPergnantCommand;
using SheepStorage.API.Application.Command.SheepMomDeliveryCommand;

namespace SheepStorage.API.Baseclass
{
    public class RbacProfile : Profile
    {
        public RbacProfile()
        {
            CreateMap<ProviderManageCreateCommand, ProviderManage>();
            CreateMap<ProviderManage, ProviderManageOutput>().ReverseMap();
            CreateMap<ProviderManage, ProviderManageInput>();
            CreateMap<ProviderManage, ProviderManageCreateCommand>().ReverseMap();
            CreateMap<ProviderManageFindCommand, ProviderManage>();
            CreateMap<ProviderManageSelectCommand, PageInput>();
            CreateMap<Enterprise, EnterpriseCreateCommand>().ReverseMap();
            CreateMap<Department, DepartmentInput>();
            CreateMap<DepartmentListCommand, Department>();

            CreateMap<UserInfo, UserInfoShowCommand>();
            CreateMap<UserInfoCreateCommand, UserInfo>();
            CreateMap<UserInfoLoginCommand, UserInfo>();
            CreateMap<SheepPurchaseSelectCommand, SheepPurchaseInput>();
            CreateMap<SheepPurchaseCreateCommand, SheepPurchase>();
            CreateMap<SheepPurchaseUpdateCommand, SheepPurchase>();
            CreateMap<UserInfo, UserInfoOutput>();

            CreateMap<EarTagAddCommand, EarTagTable>();
            CreateMap<EarTagUpdCommand, EarTagTable>();
            CreateMap<SheepMarkAddCommand, SheepMark>();
            CreateMap<SheepMarkUpdateCommand, SheepMark>();
            CreateMap<SheepDeathAddCommand, SheepDeath>();
            CreateMap<SheepDeathUpdateCommand, SheepDeath>();

            CreateMap<SheepChangeDormitory, SheepChangeDormitoryOutput>();//羊只转舍
            CreateMap<SheepChangeDormitoryinputDTO, SheepChangeDormitory>();//羊只转舍
            CreateMap<ProgenyTransferInputDTO, ProgenyTransfer>();// 后裔转种




            CreateMap<PersonnelCreateCommand, Personnel>();
            CreateMap<Personnel, PersonnelOutput>();


            CreateMap<UserInfo, UserInfoOutput>();
            CreateMap<ChangeDormAddCommand, SheepChangeDormitory>();




            CreateMap<Task<List<SheepRecordOutput>>, List<SheepRecordOutput>>()
            .ConvertUsing(src => src.Result);

            CreateMap<SheepWeaningCreateCommand, SheepMomWeaning>();
            CreateMap<SheepWeaningSelectCommand, SheepWeaningInput>();
            CreateMap<SheepWeaningUpdateCommand, SheepMomWeaning>();
            CreateMap<SheepWeaningAuditCommand, SheepWeaningStateInput>();



            CreateMap<LambWeaningCreateCommand, List<LambWeaning>>();

            CreateMap<PurchaseDTO, SheepPurchase>();
            CreateMap<LambDTO, LambWeaning>();
            CreateMap<LambWeaningSelectCommand, LambWeaningInput>();
            CreateMap<LambWeaningUpdateCommand, LambWeaning>();
            CreateMap<WeanDTO, SheepMomWeaning>();

            CreateMap<ProgenyTransferAddCommand, ProgenyTransfer>();




            CreateMap<AddYourTableName, YourTableName >();//期初添加

            CreateMap<AddSheepMomPergnant, SheepMomPergnant>();//妊娠添加

            CreateMap<AddDelivery, SheepMomDelivery>();//分娩添加

        }
    }

}
